/**
 * 
 */
package com.base.myproject.client.busi.BO;

import java.io.Serializable;
import java.util.Map;



/**
 * B2C订单对象
 * @author zgw
 *2009-8-27 下午07:30:58
 * javazgw@gmail.com
 */
public class ListOrderObject extends BaseObject implements Serializable{

	String icode; //内码
	String ordercode ; //订单号
	String ccode ; //客户编码
	String b2cgcode ;//商品编码
	String qty; //订单商品数量
	String b2cgname; //商品名称
	String orderdate ;//订单日期
	String gcode; //商品大类
	String gname; //商品大类名称
	String finalprice; //最终成交价格
	String totle; //成交总价
	String bcode;//部门人员编码
	String bname;//部门人员名称


	String cname;
	String status;

	final static String tablename = "b2clistorderg";
	public ListOrderObject ()
	{
		
	}
	  public ListOrderObject(Map<String, Object> properties) {
		    super(properties);
		 //   setProperties(properties);
		  }
	public String insert()
	{
		
		String insertsql = "insert into "+tablename+"(b2cgcode,b2cgname,gcode,gname,orderdate,qty,finalprice,totle,bcode,bname,ccode,cname,ordercode,status)";
		insertsql +="values (";
		insertsql +="'"+getB2cgcode()+"',";
		insertsql +="'"+getB2cgname()+"',";
		insertsql +="'"+getGcode()+"',";
		insertsql +="'"+getGname()+"',";
		insertsql +="'"+getOrderdate()+"',";
		insertsql +="'"+getQty()+"',";
		insertsql +="'"+getFinalprice()+"',";
		insertsql +="'"+getTotle()+"',";
		insertsql +="'"+getBcode()+"',";
		insertsql +="'"+getBname()+"',";
		insertsql +="'"+getCcode()+"',";
		insertsql +="'"+getCname()+"',";
		insertsql +="'"+getOrdercode()+"',";
		insertsql +="'"+getStatus()+"'";
		//GWT.log(insertsql, null);
		return insertsql;
	}
	public String update()
	{
		String updatesql = "update " +tablename+" set ";
		updatesql +="b2cgcode ='"+getB2cgcode()+"',";
		updatesql +="b2cgname ='"+getB2cgname()+"'";
		updatesql +=" where icode='"+getIcode()+"'";
		//GWT.log(updatesql, null);
		return updatesql;
	}
	public String delete()
	{
		String deletesql = "delete "+tablename+ " where icode ='"+icode+"'";
		//GWT.log(deletesql, null);
		return deletesql;
	}
	/**
	 * 主键相同就是同一对象，注意icode是主键
	 */
	public boolean equals(Object bo)
	{
		if(!(bo instanceof ListOrderObject))
			return false;
		if(((ListOrderObject)bo).getProperties().get("icode")==null || this.getProperties().get("icode") == null)
			return false;
		if(((ListOrderObject)bo).getProperties().get("icode").equals(this.getProperties().get("icode")))
		{
			return true;
		}
		return false;
	}
	public String toString()
	{
		return icode;
	}
	/**
	 * @return the icode
	 */
	public String getIcode() {
		return icode;
	}
	/**
	 * @param icode the icode to set
	 */
	public void setIcode(String icode) {
		this.icode = icode;
	}
	/**
	 * @return the ordercode
	 */
	public String getOrdercode() {
		return ordercode;
	}
	/**
	 * @param ordercode the ordercode to set
	 */
	public void setOrdercode(String ordercode) {
		this.ordercode = ordercode;
	}
	/**
	 * @return the ccode
	 */
	public String getCcode() {
		return ccode;
	}
	/**
	 * @param ccode the ccode to set
	 */
	public void setCcode(String ccode) {
		this.ccode = ccode;
	}
	/**
	 * @return the b2cgcode
	 */
	public String getB2cgcode() {
		return b2cgcode;
	}
	/**
	 * @param b2cgcode the b2cgcode to set
	 */
	public void setB2cgcode(String b2cgcode) {
		this.b2cgcode = b2cgcode;
	}
	/**
	 * @return the qty
	 */
	public String getQty() {
		return qty;
	}
	/**
	 * @param qty the qty to set
	 */
	public void setQty(String qty) {
		this.qty = qty;
	}
	/**
	 * @return the b2cgname
	 */
	public String getB2cgname() {
		return b2cgname;
	}
	/**
	 * @param b2cgname the b2cgname to set
	 */
	public void setB2cgname(String b2cgname) {
		this.b2cgname = b2cgname;
	}
	/**
	 * @return the orderdate
	 */
	public String getOrderdate() {
		return orderdate;
	}
	/**
	 * @param orderdate the orderdate to set
	 */
	public void setOrderdate(String orderdate) {
		this.orderdate = orderdate;
	}
	/**
	 * @return the gcode
	 */
	public String getGcode() {
		return gcode;
	}
	/**
	 * @param gcode the gcode to set
	 */
	public void setGcode(String gcode) {
		this.gcode = gcode;
	}
	/**
	 * @return the gname
	 */
	public String getGname() {
		return gname;
	}
	/**
	 * @param gname the gname to set
	 */
	public void setGname(String gname) {
		this.gname = gname;
	}
	/**
	 * @return the finalprice
	 */
	public String getFinalprice() {
		return finalprice;
	}
	/**
	 * @param finalprice the finalprice to set
	 */
	public void setFinalprice(String finalprice) {
		this.finalprice = finalprice;
	}
	/**
	 * @return the totle
	 */
	public String getTotle() {
		return totle;
	}
	/**
	 * @param totle the totle to set
	 */
	public void setTotle(String totle) {
		this.totle = totle;
	}
	/**
	 * @return the bcode
	 */
	public String getBcode() {
		return bcode;
	}
	/**
	 * @param bcode the bcode to set
	 */
	public void setBcode(String bcode) {
		this.bcode = bcode;
	}
	/**
	 * @return the bname
	 */
	public String getBname() {
		return bname;
	}
	/**
	 * @param bname the bname to set
	 */
	public void setBname(String bname) {
		this.bname = bname;
	}
	/**
	 * @return the cname
	 */
	public String getCname() {
		return cname;
	}
	/**
	 * @param cname the cname to set
	 */
	public void setCname(String cname) {
		this.cname = cname;
	}
	/**
	 * @return the status
	 */
	public String getStatus() {
		return status;
	}
	/**
	 * @param status the status to set
	 */
	public void setStatus(String status) {
		this.status = status;
	}
	
}
